import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 22652
 * Date: 2024-04-24
 * Time: 18:55
 */
public class Dome_01 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            String res = "";
            int a = in.nextInt();
            while (a >= 1000) {
                int tmp = a % 1000;
                a = a / 1000;
                if (tmp == 0) {
                    res = ",000" + res;
                } else if (tmp > 0 && tmp < 10) {
                    res = ",00" + tmp + res;
                } else if (tmp >= 10 && tmp < 100) {
                    res = ",0" + tmp + res;
                } else {
                    res = "," + tmp + res;
                }
            }
            res = "" + a + res;
            System.out.println(res);
        }
    }
}
